<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            background-color: aqua;
            width: 500px;
            height: 200px;
        }
        button{
            float:right;
            color:black;
        }
    </style>
</head>
<body>
    <div class="box">
            <button>X</button>
    </div>
    

    <script>
        
        const a=document.querySelector('.box')
        const b=document.querySelector('button')
        b.addEventListener('click',function(){
            a.style.display='none';
        
    
        });
    </script>
</body>
</html>